/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package cn.hxcx.top.modules.dvc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.hxcx.top.common.persistence.Page;
import cn.hxcx.top.common.service.CrudService;
import cn.hxcx.top.modules.dvc.entity.DeviceMana;
import cn.hxcx.top.modules.dvc.dao.DeviceManaDao;

/**
 * 设备报修Service
 * @author DoubleX
 * @version 2019-07-13
 */
@Service
@Transactional(readOnly = true)
public class DeviceManaService extends CrudService<DeviceManaDao, DeviceMana> {
	
	@Autowired
	private DeviceManaDao deviceManaDao;
	
	public DeviceMana get(String id) {
		return super.get(id);
	}
	
	public List<DeviceMana> findList(DeviceMana deviceMana) {
		return super.findList(deviceMana);
	}
	
	public Page<DeviceMana> findPage(Page<DeviceMana> page, DeviceMana deviceMana) {
		return super.findPage(page, deviceMana);
	}
	
	public Boolean hasSameDevice(String deviceId) {
		List<DeviceMana> list = deviceManaDao.findRepairedList(deviceId);
		return list.size()>0;
	}
	
	@Transactional(readOnly = false)
	public void save(DeviceMana deviceMana) {
		super.save(deviceMana);
	}
	
	@Transactional(readOnly = false)
	public void delete(DeviceMana deviceMana) {
		super.delete(deviceMana);
	}
	
}